﻿Namespace EIBData.DPT
    Public NotInheritable Class EIBDataDPT_20_005
        Inherits EIBDataDPT_20_Base

        Public Enum EIBDataDPT_20_005_Values
            Normal = 0
            PresenceSimulation = 1
            NightRound = 2
        End Enum

        Protected _value As EIBDataDPT_20_005_Values = Nothing


        Sub New(data As Byte())
            MyBase.New(data)

            _value = _valueBase
        End Sub

        Sub New(value As EIBDataDPT_20_005_Values)
            MyBase.New(value)

            _value = value
        End Sub


        Public Overrides Function ToInfoList() As List(Of EIB.InfoBase)
            Dim list As New List(Of EIB.InfoBase)

            list.Add(New EIB.Info("Type", DPT_Name))
            If _value > 16 Then
                list.Add(New EIB.Info("Value", String.Format("{0} (0x{1:X})", "ManufacturerSpecific", _value)))
            ElseIf _value > 2 Then
                list.Add(New EIB.Info("Value", String.Format("{0} (0x{1:X})", "Reserved", _value)))
            Else
                list.Add(New EIB.Info("Value", String.Format("{0} (0x{0:X})", _value)))
            End If

            Return list
        End Function

        Public Shared Shadows ReadOnly Property DPT_Name As String
            Get
                Return "DPT_LightApplicationMode"
            End Get
        End Property

        Public Shared Shadows ReadOnly Property DPT_Number As String
            Get
                Return "20.005"
            End Get
        End Property

        Public Overrides Function ToString() As String
            If _value > 16 Then
                Return "ManufacturerSpecific"
            ElseIf _value > 2 Then
                Return "Reserved"
            Else
                Return _value
            End If
        End Function

        Public Overloads ReadOnly Property Value As EIBDataDPT_20_005_Values
            Get
                Return _value
            End Get
        End Property
    End Class
End Namespace